<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>用户信息详情页</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="../../css/font.css">
    <link rel="stylesheet" href="../../css/xadmin.css">
    <script type="text/javascript"
            src="../../lib/vue/jquery.min.js"></script>
    <script type="text/javascript" src="../../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../../js/xadmin.js"></script>
    <script type="text/javascript" src="../../js/global.js"></script>
    <script type="text/javascript" src="../../js/store.js"></script>
    <script type="text/javascript" src="../../js/cookies.js"></script>
    <script src="../../lib/vue/vue.min.js"></script>
    <script src="../../lib/vue/axios.min.js"></script>
    <style>
        h4 {
            font-size: 16px;
            text-align: center;
        }

        h4 a {
            color: red;
            font-weight: bolder;
        }
    </style>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-table-box">
        <div class="layui-table-header">
            <h3 style="color: #9F9F9F" align="center">用户信息详情</h3>
        </div>
        <hr>
        <div id="userDetail">
            <div style="width: 530px;margin: auto;">
                <form class="layui-form  layui-form-pane">
                    <!--<div class="layui-form-item">
                        <label for="tenantName" class="layui-form-label" style="width: 120px">
                            租户ID
                        </label>
                        <div class="layui-input-inline" style="width: 400px;">
                            <input type="text" name="tenantCode" readonly=""
                                   lay-verify="tenantName" v-model="tenantCode"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>-->
                    <div class="layui-form-item">
                        <label for="companyName" class="layui-form-label" style="width: 120px">
                            公司名称
                        </label>
                        <div class="layui-input-inline" style="width: 400px;">
                            <input type="text" id="companyName" name="companyName" readonly=""
                                   lay-verify="companyName" v-model="companyName"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="sysName" class="layui-form-label" style="width: 120px">
                            所属系统
                        </label>
                        <div class="layui-input-inline" style="width: 400px;">
                            <input type="text" id="sysName" name="sysName" readonly=""
                                   lay-verify="sysName" v-model="sysName"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="username" class="layui-form-label" style="width: 120px">
                            用户名
                        </label>
                        <div class="layui-input-inline" style="width: 400px;">
                            <!-- 用户名 -->
                            <input type="text" id="username" name="username" readonly=""
                                   lay-verify="required" v-model="username"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="userType" class="layui-form-label" style="width: 120px">
                            角色
                        </label>
                        <div class="layui-input-inline" style="width: 400px;">
                            <input type="text" id="userType" name="userType" readonly="" v-model="userType"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="componentName" class="layui-form-label" style="width: 120px">
                            负责组件
                        </label>
                        <div class="layui-input-inline" style="width: 400px;">
                            <input type="text" id="componentName" name="componentName" readonly=""
                                   v-model="componentName"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <hr>
    </div>
</div>
<script>
    $.get(_hostUrl + '/cmsManager/' + parseInt(getCookie('userId')), null, function (res) {
        if (res.responseCode == 200) {
            let vm = new Vue({
                el: '#userDetail',
                data() {
                    return {
                        username: '',
                        companyName: '',
                        userType: '',
                        sysName: '',
                        componentName: ''
                    }
                },
                beforeMount() {
                    this.companyName = res.data.companyName;
                    if (null === this.companyName || '' === this.companyName) {
                        this.companyName = '不存在公司信息'
                    }
                    this.sysName = res.data.sysName;
                    if (null === this.sysName || '' === this.sysName) {
                        this.sysName = '不存在系统信息'
                    }
                    this.componentName = res.data.componentNames;
                    if (null === this.componentName || '' === this.componentName) {
                        if (getCookie('userType') === '4' || getCookie('userType') === '2') {
                            this.componentName = '包含所有组件'
                        } else {
                            this.componentName = '不包含任何组件'
                        }
                    }
                    this.username = getCookie('username')
                    if (getCookie('userType') === '4') {
                        this.userType = '超级管理员'
                    } else if (getCookie('userType') === '3') {
                        this.userType = '组件管理员'
                    } else if (getCookie('userType') === '2') {
                        this.userType = '开发公司系统负责人'
                    } else {
                        this.userType = '开发公司组件接入人员'
                    }
                }
            })
        } else {
            layui.layer.msg('登录已失效', {
                icon: 2,
                timeout: 2000
            }, function () {
                parent.location.href = '../../login.html'
            })
        }
    })
</script>
</body>
</html>



